<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>spring-js</title>
    <script src="jquery-3.3.1.js"></script>
</head>

<body>
    
    <script>
        $(function () {
            $("button").click(function(){
                $.ajax({
                    url:"mvc_ajax_request/string",
                    context:document.getElementById("AjaxResult")
                }).done(function(data){
                    alert("ajax request done");
                    $(this).text(data);
                });
            });
        });

    </script>
    <button >ajax请求</button>
    <h4>ajax request result:</h4>
    <div style="border: 1px solid blue; width: 400px; height:100px" id="AjaxResult">

    </div>
</body>

</html>